package com.leo.test;

/**
 *
 * @author xuexiaolei
 * @version 2017年10月13日
 */
public class UnsafePublish implements Runnable {
    @Override public void run() {
        UnsafePublish.Holder holder = new Holder(2);
        holder.assertSanity();
    }

    class Holder{
        private int n;
        public Holder(int n){ this.n = n; }
        public void assertSanity(){
            if (n != n) throw new AssertionError("statement is false");
        }
    }

    public static void main(String[] args) {
        for (int i = 0; i < 100; i++) {
            UnsafePublish test = new UnsafePublish();
            test.run();
        }
    }
}
